/**
 * 
 */
package com.appspot.yttv.client;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.Timer;

/**
 * @author Richard Tucker
 *
 */
public class StationLabel implements HasText {
	private final Label label = new Label();
    private final FadeTimer timer = new FadeTimer();
    private final int FADETIME = 2000;

	public StationLabel() {
		label.setStyleName("stationid_hidden");
	}
	
	public Label getLabel() {
		return label;
	}
	
	public void setText(String text) {
		timer.schedule(FADETIME);
		label.setText(text);
		label.setStyleName("stationid");
	}
	
    private class FadeTimer extends Timer {
        public void run() {
    		label.setStyleName("stationid_hidden");
        }
    }
    
	public String getText() {
		return label.getText();
	}
}
